﻿
@{
    ViewBag.Title = "打印";
}
@section scripts
{
    <link href="@Url.Content("~/content/css/kingprt.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/content/css/font-awesome.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.PrintArea.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/Base/print.js")" type="text/javascript"></script> 
}
<div class="prtTools">
    <div class="tool">
        <a href="#" class="button fa-print btnPrint">打印</a>
        <!--<a href="#" class="button next">关闭</a>-->
    </div>
</div>
<script>

    $(function () {
        $(".btnPrint").click(function () {
            $(".A4_verPrint").printArea();
        });
        $(".next").click(function () {
            mini.confirm("您确定要关闭本页吗？", "提示", callfun);
        });
    });

    function callfun(action)
    {
        if (action == "ok") {
            window.opener = null;
            window.open('', '_self');
            window.close();
        }
        else {
            PrintSet();
        }
    }


    function InitalPrint(grid, noneDisplay,headText) {
        NoneDisplay = noneDisplay;
        var data = PrepareData(grid);//准备数据
        if (headText == undefined)
            data.headtext = "数据表格";
        else
            data.headtext = headText; //表头
        $("body").append(getHtml(data)); //生成
    }


</script>